package com.beilang.base.pagination;

import java.util.List;

public class PaginationHelper {
	
    public static final String REC_PER_PAGE = "REC_PER_PAGE";
    public static final String CURRENT_RANGE = "CURRENT_RANGE";
    public static final String SORT_DIR = "SORT_DIR";
    public static final String SORT_FIELD = "SORT_FIELD";
	
	private String sortField;

	private String sortDir="DESC";

	private int start=0;

	private int objectPerPage=10;

	private List list;

	private int totalSize;

	public String getSortField() {
		return sortField;
	}

	public void setSortField(String sortField) {
		this.sortField = sortField;
	}

	public String getSortDir() {
		return sortDir;
	}

	public void setSortDir(String sortDir) {
		this.sortDir = sortDir;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}
	
	public int getEnd() {
		return start+objectPerPage>totalSize?totalSize:start+objectPerPage;
	}	

	public int getObjectPerPage() {
		return objectPerPage;
	}

	public void setObjectPerPage(int objectPerPage) {
		this.objectPerPage = objectPerPage;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public int getTotalSize() {
		return totalSize;
	}

	public void setTotalSize(int totalSize) {
		this.totalSize = totalSize;
	}
	
	

}
